<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Carte mère:  Fichier source de src/imu.h</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Généré par Doxygen 1.7.2 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="main.html"><span>Page&#160;principale</span></a></li>
      <li><a href="pages.html"><span>Pages&#160;associées</span></a></li>
      <li><a href="annotated.html"><span>Structures&#160;de&#160;données</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Portée&#160;globale</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>src/imu.h</h1>  </div>
</div>
<div class="contents">
<a href="imu_8h.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**********************************</span>
<a name="l00002"></a>00002 <span class="comment">* imu.h</span>
<a name="l00003"></a>00003 <span class="comment">* Définition de la structure de données, gestion de la réception des données de la centrale inertielle</span>
<a name="l00004"></a>00004 <span class="comment">* Par Guillaume STRUB (MIQ4) le 2/12/2010</span>
<a name="l00005"></a>00005 <span class="comment">**********************************/</span>
<a name="l00006"></a>00006 
<a name="l00007"></a>00007 <span class="preprocessor">#ifndef _IMU_H</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span><span class="preprocessor">#define _IMU_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span>
<a name="l00010"></a>00010 <span class="comment">/*</span>
<a name="l00011"></a>00011 <span class="comment">CF : Inertia-Link-3DM-GX2-data-communications-protocol.pdf</span>
<a name="l00012"></a>00012 <span class="comment">Function:       The Inertia-Link® or 3DM-GX2 will output a data record containing its orientation in the form of Euler Angles, and the Angular Rates</span>
<a name="l00013"></a>00013 <span class="comment">Command Byte:   0xCF</span>
<a name="l00014"></a>00014 <span class="comment">Command Data:   None</span>
<a name="l00015"></a>00015 <span class="comment">Response:       31 bytes defined as follows</span>
<a name="l00016"></a>00016 <span class="comment">Byte 1          Header = 0xCF</span>
<a name="l00017"></a>00017 <span class="comment">Bytes 2-5       Roll</span>
<a name="l00018"></a>00018 <span class="comment">Bytes 6-9       Pitch</span>
<a name="l00019"></a>00019 <span class="comment">Bytes 10-13     Yaw</span>
<a name="l00020"></a>00020 <span class="comment">Bytes 14-17     AngRateX</span>
<a name="l00021"></a>00021 <span class="comment">Bytes 18-21     AngRateY</span>
<a name="l00022"></a>00022 <span class="comment">Bytes 22-25     AngRateZ</span>
<a name="l00023"></a>00023 <span class="comment">Bytes 26-29     Timer</span>
<a name="l00024"></a>00024 <span class="comment">Bytes 30-31     Checksum</span>
<a name="l00025"></a>00025 <span class="comment">*/</span><span class="comment"></span>
<a name="l00026"></a>00026 <span class="comment">//! Structure contenant les angles d&#39;Euler et les vitesses angulaires mesurés par la centrale</span>
<a name="l00027"></a><a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html">00027</a> <span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{<span class="comment"></span>
<a name="l00028"></a>00028 <span class="comment">        //! Angle de roulis en radians</span>
<a name="l00029"></a><a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#af79ccc911350fc77ca0c2f9d23c3e08d">00029</a> <span class="comment"></span>        <span class="keywordtype">float</span> <a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#af79ccc911350fc77ca0c2f9d23c3e08d" title="Angle de roulis en radians.">roulis</a>;<span class="comment"></span>
<a name="l00030"></a>00030 <span class="comment">        //! Angle de tangage en radians</span>
<a name="l00031"></a><a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#a8d79e41179ac09319e4109bd6cf14b7d">00031</a> <span class="comment"></span>        <span class="keywordtype">float</span> <a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#a8d79e41179ac09319e4109bd6cf14b7d" title="Angle de tangage en radians.">tangage</a>;<span class="comment"></span>
<a name="l00032"></a>00032 <span class="comment">        //! Angle de lacet en radians</span>
<a name="l00033"></a><a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#a24be9b22fad2a0bc626ef61735370641">00033</a> <span class="comment"></span>        <span class="keywordtype">float</span> <a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#a24be9b22fad2a0bc626ef61735370641" title="Angle de lacet en radians.">lacet</a>;<span class="comment"></span>
<a name="l00034"></a>00034 <span class="comment">        //! Vitesse angulaire de roulis</span>
<a name="l00035"></a><a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#a971f851ae6f044193c3602232423430f">00035</a> <span class="comment"></span>        <span class="keywordtype">float</span> <a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#a971f851ae6f044193c3602232423430f" title="Vitesse angulaire de roulis.">vit_roulis</a>;<span class="comment"></span>
<a name="l00036"></a>00036 <span class="comment">        //! Vitesse angulaire de tangage</span>
<a name="l00037"></a><a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#abefe21b27d9106d31c20773493e9f908">00037</a> <span class="comment"></span>        <span class="keywordtype">float</span> <a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#abefe21b27d9106d31c20773493e9f908" title="Vitesse angulaire de tangage.">vit_tangage</a>;<span class="comment"></span>
<a name="l00038"></a>00038 <span class="comment">        //! Vitesse angulaire de lacet</span>
<a name="l00039"></a><a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#a0e4db5aedee7ef096280daeede46e9d3">00039</a> <span class="comment"></span>        <span class="keywordtype">float</span> <a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#a0e4db5aedee7ef096280daeede46e9d3" title="Vitesse angulaire de lacet.">vit_lacet</a>;<span class="comment"></span>
<a name="l00040"></a>00040 <span class="comment">        //! Temps écoulé entre deux trames en secondes</span>
<a name="l00041"></a><a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#a5c0c5bd4a75e52aa31d6277feb83fc3d">00041</a> <span class="comment"></span>        <span class="keywordtype">float</span> <a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html#a5c0c5bd4a75e52aa31d6277feb83fc3d" title="Temps écoulé entre deux trames en secondes.">temps_ecoule</a>;
<a name="l00042"></a>00042 } <a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html" title="Structure contenant les angles d&amp;#39;Euler et les vitesses angulaires mesurés par la centrale...">IMU_ANGLES_VITESSES</a>;
<a name="l00043"></a>00043 <span class="comment"></span>
<a name="l00044"></a>00044 <span class="comment">//! Longueur d&#39;une trame d&#39;angles</span>
<a name="l00045"></a><a class="code" href="imu_8h.html#a0ad587305d1e50ecc364037dee570ca8">00045</a> <span class="comment"></span><span class="preprocessor">#define LG_IMU_ANGLES_VITESSES          31</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="comment">//! Commande permettant de récupérer les angles d&#39;Euler et les vitesses angulaires</span>
<a name="l00047"></a><a class="code" href="imu_8h.html#afb4ebd47bea9dfbcecd206cab11a1bf1">00047</a> <span class="comment"></span><span class="preprocessor">#define CMD_IMU_ANGLES_VITESSES         0xCF</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="comment">//! Commande de passage en mode continu</span>
<a name="l00049"></a>00049 <span class="comment"></span><span class="comment">/*! Pour passer en mode continu, il est nécessaire d&#39;envoyer à la centrale </span>
<a name="l00050"></a>00050 <span class="comment">une séquence de 4 octets définie comme suit :</span>
<a name="l00051"></a>00051 <span class="comment">0xC4 0xC1 0x29 &lt;cmd&gt; avec cmd l&#39;octet désignant la commande à répéter</span>
<a name="l00052"></a>00052 <span class="comment">\sa imuContinuousMode</span>
<a name="l00053"></a>00053 <span class="comment">*/</span>
<a name="l00054"></a><a class="code" href="imu_8h.html#a8c7d78c48e209a58685d8398478dc956">00054</a> <span class="preprocessor">#define CMD_IMU_MODE_CONTINU            0xC4</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="comment">//! Premier octet de confirmation de passage en mode continu</span>
<a name="l00056"></a><a class="code" href="imu_8h.html#a67e80ee7226a0a226c308b970bcc4182">00056</a> <span class="comment"></span><span class="preprocessor">#define CMD_IMU_MODE_CONTINU_CONF1      0xC1</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="comment">//! Second octet de confirmation</span>
<a name="l00058"></a><a class="code" href="imu_8h.html#a62ce8783fe0b603d733be69972c7bce4">00058</a> <span class="comment"></span><span class="preprocessor">#define CMD_IMU_MODE_CONTINU_CONF2      0x29</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00060"></a>00060 <span class="comment">//! Structure contenant les angles de la centrale inertielle</span>
<a name="l00061"></a>00061 <span class="comment"></span><span class="keyword">extern</span> <span class="keyword">volatile</span> <a class="code" href="struct_i_m_u___a_n_g_l_e_s___v_i_t_e_s_s_e_s.html" title="Structure contenant les angles d&amp;#39;Euler et les vitesses angulaires mesurés par la centrale...">IMU_ANGLES_VITESSES</a> <a class="code" href="imu_8c.html#a1cdf2ec6dff64089373e3df2eee1da41" title="Structure contenant les angles de la centrale inertielle.">angles</a>;
<a name="l00062"></a>00062 <span class="comment"></span>
<a name="l00063"></a>00063 <span class="comment">//! Flag de mise à jour des angles de la centrale inertielle</span>
<a name="l00064"></a>00064 <span class="comment"></span><span class="comment">/**</span>
<a name="l00065"></a>00065 <span class="comment">* Il est mis à 1 lorsqu&#39;une trame complète est reçue</span>
<a name="l00066"></a>00066 <span class="comment">*/</span>
<a name="l00067"></a>00067 <span class="keyword">extern</span> <span class="keyword">volatile</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code" href="imu_8c.html#ad0cb47b4f41eb0a0dd57ce7a74766207" title="Flag de mise à jour des angles de la centrale inertielle.">anglesMAJ</a>;
<a name="l00068"></a>00068 <span class="comment"></span>
<a name="l00069"></a>00069 <span class="comment">//! Met l&#39;IMU en mode d&#39;émission continue</span>
<a name="l00070"></a>00070 <span class="comment"></span><span class="comment">/*!</span>
<a name="l00071"></a>00071 <span class="comment">Cette fonction met l&#39;IMU en mode émission continue, avec la commande passée en paramètre</span>
<a name="l00072"></a>00072 <span class="comment">\param commandByte la commande à répéter</span>
<a name="l00073"></a>00073 <span class="comment">*/</span>
<a name="l00074"></a>00074 <span class="keywordtype">void</span> <a class="code" href="imu_8c.html#a2874e868e54ebbcecbc8fc22ab0e8dac" title="Met l&amp;#39;IMU en mode d&amp;#39;émission continue.">imuContinuousMode</a> (<span class="keywordtype">char</span> commandByte);
<a name="l00075"></a>00075 
<a name="l00076"></a>00076 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Généré le Wed Jan 5 2011 17:04:29 pour Carte mère par&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
